<%--
  Created by IntelliJ IDEA.
  User: jxxy
  Date: 2019/11/10
  Time: 9:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page pageEncoding="UTF-8"%>
<html>
  <head>
    <title>$Title$</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="css/bootstrap.css">
    <script src="js/jquery-3.3.1.js"></script>
    <script src="js/bootstrap.js"></script>
    <script>
        function deleteEmp(no) {
            alert("即将删除员工");
            window.location.href="deleteEmp?empno="+no;
        }
        function updateEmp(no) {
            window.location.href="updateEmp?empno="+no;
        }
    </script>
  </head>

  <body>
    <div class="container">
      <div class="col-md-10">
        <div class="panel">
          <div class="panel-title">
            员工信息表
          </div>
          <div class="panel-body">
            <table class="table table-bordered table-striped">
              <th>empno</th>
              <th>ename</th>
              <th>操作</th>
              <c:forEach items="${requestScope.empData}" var="emp">
                <tr>
                  <td>${emp.empno}</td>
                  <td>${emp.ename}</td>
                  <td>
                    <a href="javascript:void(0)" onclick="deleteEmp(${emp.empno})" >删除</a>
                    <!--<a href="/deleteEmp?empno=${emp.empno}">删除</a>-->

                    <a href="javascript:void(0)" onclick="updateEmp(${emp.empno})" >修改</a>
                  </td>
                </tr>
              </c:forEach>
            </table>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
